﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TJ_RSJXModeWebForm.aspx.cs" Inherits="Anke.SHManage.Web.Reports.RSJXModeWebForm" %>

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>人事科绩效相关统计表</title>
    <script src="../Content/EasyUI/jquery.js"></script>
    <script src="../Content/EasyUI/jquery.easyui.js"></script>
    <script src="../Content/EasyUI/locale/easyui-lang-zh_CN.js"></script>
    <link href="../Content/EasyUI/themes/icon.css" rel="stylesheet" />
    <link href="../Content/EasyUI/themes/default/easyui.css" rel="stylesheet" />
    <script src="../Scripts/jquery.AnkeExtend.js"></script>

    <script type="text/javascript">
        //页面加载
        $(document).ready(function () {
            DisableBackspace();
            fillCombobox();
        });
        //#region 为Combobox增加--请选择--
        function EUIcombobox(jqS, o) {
            $.ajax({
                type: "POST",
                async: false,
                url: o.url,
                dataType: "JSON",
                success: function (data1, textStatus, jqXHR) {
                    o.data = o.OneOption.concat(data1); 
                    delete o.url;
                    delete o.OneOption;
                    $(jqS).combobox(o);
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("获取字典数据失败！可能是已经超时，请重新登录！");
                }
            });
        }
        //查询条件取下拉值列表
        function fillCombobox() {
            EUIcombobox("#centerID", {
                url: "../Medical/GetCenter/",
                valueField: 'ID',
                textField: 'Name',
                //prompt: '--请选择--',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }],
                onSelect: function (rec) {
                    var urlstation = "../Medical/GetStation?code=" + rec.ID;
                    EUIcombobox("#stationID", {
                        url: urlstation,
                        valueField: 'ID',
                        textField: 'Name',
                        //prompt: '--请选择--',
                        editable: false,
                        OneOption: [{
                            ID: "",
                            Name: "--请选择--"
                        }]
                    });
                }
            });
            //#endregion
            //#region 出车分站
            EUIcombobox("#stationID", {
                url: "../Medical/GetStation?code=",
                valueField: 'ID',
                textField: 'Name',
                //prompt: '--请选择--',
                editable: false,
                OneOption: [{
                    ID: "",
                    Name: "--请选择--"
                }],
                onSelect: function (rec) {
                    var zz = "../CM/CarBasicInfo/getPlateByStationID?stationCode=" + rec.ID;
                    EUIcombobox("#actualCode", {
                        url: zz,
                        valueField: 'PlateNumber',
                        textField: 'PlateNumber',
                        editable: false,
                        OneOption: [{
                            PlateNumber: "",
                            PlateNumber: "--请选择--"
                        }]
                    });
                    var zzz = "../CM/CarBasicInfo/getPlateByStationID?stationCode=" + rec.ID;
                    EUIcombobox("#ambulanceNumber", {
                        url: zzz,
                        valueField: 'PlateNumber',
                        textField: 'CarNumber',
                        editable: false,
                        OneOption: [{
                            PlateNumber: "",
                            CarNumber: "--请选择--"
                        }]
                    });
                },
                onChange: function (newValue, oldValue) {
                    $("#ambulanceNumber").combobox('clear');
                    $("#actualCode").combobox('clear');
                }
            });
            //车辆牌号 初始化
            EUIcombobox("#actualCode", {
                url: "../CM/CarBasicInfo/getPlateByStationID?stationCode=",
                valueField: 'PlateNumber',
                textField: 'PlateNumber',
                editable: true,
                OneOption: [{
                    PlateNumber: "",
                    PlateNumber: "--请选择--"
                }],
                filter: function (q, row) {
                    var opts = $('#actualCode').combobox('options');
                    return row[opts.textField].indexOf(q) > -1;
                },
                onSelect: function (rec) {

                    $("#ambulanceNumber").combobox('setValue', rec.PlateNumber);  //根据选择车牌对应的ID ，给车辆编号赋值
                }
            });
            EUIcombobox("#ambulanceNumber", {       //选择车辆编号的联动 初始化
                url: "../CM/CarBasicInfo/getCarNumberByID?ID=",
                valueField: 'PlateNumber',
                textField: 'CarNumber',
                editable: true,
                OneOption: [{
                    PlateNumber: "",
                    CarNumber: "--请选择--"
                }],
                filter: function (q, row) {
                    var opts = $('#ambulanceNumber').combobox('options');
                    return row[opts.textField].indexOf(q) > -1;
                },
                onSelect: function (rec) {
                    $("#actualCode").combobox('setValue', rec.PlateNumber);  //根据选择车辆编号对应的ID，给车牌号赋值 初始化
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <table border="0">
            <tr>
                <td>查询时间：</td>
                <td>
                    <asp:TextBox ID="StartDate" class="easyui-datebox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>至：</td>
                <td>
                    <asp:TextBox ID="EndDate" class="easyui-datebox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>司机：</td>
                <td>
                    <asp:TextBox ID="Driver" class="easyui-textbox" Style="width: 130px" runat="server"></asp:TextBox>
                </td>
                <td>医生：</td>
                <td>
                    <asp:TextBox ID="Doctor" class="easyui-textbox" Style="width: 130px" runat="server"></asp:TextBox>
                </td>          
                <td>护士：</td>
                <td>
                    <asp:TextBox ID="Nurse" class="easyui-textbox" Style="width: 130px" runat="server"></asp:TextBox>
                </td>                      
            </tr>
            <tr>
                <td>分中心：</td>
                <td>
                    <asp:TextBox ID="centerID" class="easyui-combobox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>分站：</td>
                <td>
                    <asp:TextBox ID="stationID" class="easyui-combobox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>车牌号码：</td>
                <td>
                    <asp:TextBox ID="actualCode" class="easyui-combobox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>车辆编号：</td>
                <td>
                    <asp:TextBox ID="ambulanceNumber" class="easyui-combobox" Style="width: 130px" runat="server" editable="false"></asp:TextBox>
                </td>
                <td>担架员：</td>
                <td>
                    <asp:TextBox ID="Stretcher" class="easyui-textbox" Style="width: 130px" runat="server"></asp:TextBox>
                </td>    
                <td>&nbsp;&nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询" OnClick="btnSearch_Click" />
                    &nbsp;                      
                </td>
            </tr>
        </table>
        <div style="background-color: #fafafa; border-left: 1px solid scrollbar; overflow: hidden; height: 100%;">
            <rsweb:ReportViewer ID="ReportViewer1" Width="100%" Height="100%" runat="server"  SizeToReportContent="True"></rsweb:ReportViewer>
        </div>
    </form>
</body>
</html>

